home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2341 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.7 KB

  1. Path: sn.no!not-for-mail
  2. From: mobergru@oslonett.no (Rune Moberg)
  3. Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
  4. Subject: Re: C++ with Zapp vs. Delphi
  5. Date: 17 Jan 1996 04:27:52 +0100
  6. Organization: CD-Player Pro author!
  7. Message-ID: <WaE/w0JfFiKC089yn@oslonett.no>
  8. References: <4coar6$d4n@sun4.bham.ac.uk> <4coip7$69s@news1.usa.pipeline.com>
  9.  <Eul+w0JfFyQD089yn@oslonett.no> <4dfnr9$4c02@tigger.cc.uic.edu>
  10. NNTP-Posting-Host: hasle.sn.no
  11. Mime-Version: 1.0
  12. Content-Type: text/plain; charset=ISO-8859-1
  13. Content-Transfer-Encoding: 8bit
  14.  
  15. In article <4dfnr9$4c02@tigger.cc.uic.edu>,
  16. olczyk@sunphy1 (Thadeus Olczyk) wrote:
  17. >Unfortunately it was late two hours ago.
  18. >I will follow up more thoroughy later but there were two parts I couldn't
  19. >resist.
  20.  
  21. Thought as much... :-)
  22.  
  23. >Rune Moberg (mobergru@oslonett.no) wrote:
  24. >:   typedef int (*CFT) (void*,void*);
  25. >:   void sort(void* base, unsigned n, unsigned int sz, CFT cmp)"
  26. >: (don't worry, the n-key wasn't sticky after all, so typing went ahead
  27. >: at full speed. Bjarne mentions MI a couple of places (4), but not as
  28. >: a requirement for polymorphism)
  29. >
  30. >: Now, I have some C experience (half a year), but the above is totally
  31. >If you can't read the above then your half year of experience was rather 
  32. >poor. Unfortunately the biggest fraud in the computer world are the shelves
  33.  
  34. Ok. What I meant to say, was:
  35. "Now, I have some C experience (half a year), but the above is something
  36. I no longer automatically recognise"
  37.  
  38. Anyway, without looking in any books, this is what I deciphered:
  39.  
  40. void (ah, a function returning nothing - aka procedure in Pascal)
  41. sort (the function name)
  42. void* base (uhm... An undefined pointer?)
  43. unsigned n (probably an unsigned integer - aka word in Pascal)
  44. unsigned int sz (definatively an unsigned integer)
  45. CFT cmp (right, a variable of type CFT declared above)
  46.  
  47. typedef int (*CFT) (void*,void*);
  48. is what got me. What is this? Could it be a typedeclaring a function
  49. returning an int, with two undefined arguments (pointers)? It would
  50. probably deserve a comment (or three), or one could write it in Pascal.
  51.  
  52. >:   (Sender as TEdit).CutToClipboard;
  53. >: will work for TEdit and all descendants of TEdit, but will generate an
  54. >: exception for any other object.
  55. >
  56. >: Object Pascal has a different type cast (also available in Delphi) that
  57. >: instead of generating an exception will most probably crash (AFAIK):
  58. >:   TEdit(Sender).CutToClipboard;  {a somewhat more direct approach}
  59. >For an event this is fine. But for a method it's not. A method won't know 
  60.  
  61. An event is just another method, handling all TObject descendants
  62. (through the Sender parameter of type TObject)? 
  63.                                                                   
  64. -- 
  65. =\
  66.  *=- R.Moberg, CD-Player Pro info @ http://www.sn.no/~mobergru/
  67. =/
  68.